package com.ruanda.service;

import com.ruanda.domain.Basket;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruanda.vo.CartTotalAmount;
import com.ruanda.vo.CartVo;

import java.util.List;

/**
* @author 亦樂
* @description 针对表【basket(购物车)】的数据库操作Service
* @createDate 2024-09-08 15:57:34
*/
public interface BasketService extends IService<Basket> {

    /**
     * prodCount
     * @param openId
     * @return
     */
    Integer queryMemberBasketProdCount(String openId);

    /**
     * 查询会员购物车页面数据
     * @return
     */
    CartVo queryMemberCartVo();

    /**
     * 计算会员选中购物车中商品的金额
     * @param basketIds
     * @return
     */
    CartTotalAmount calculateMemberCheckedBasketTotalAmount(List<Long> basketIds);

    /**
     * 添加商品到购物车或修改商品在购物车中的数量
     * @param basket
     * @return
     */
    Boolean changeCartItem(Basket basket);
}
